void settings(){
	int now=0,nowlanguage=language,nowcolor=color;
	system("cls");
		gotoXY(34,7);
		printf(SETTINGS[language][0][nowlanguage]);
		gotoXY(34,9);
		printf(SETTINGS[language][1][nowcolor]);
	char c=0;
	gotoXY(31,7);
	printf(">");
	while(c!='\r'){
		while(!kbhit()){
			
		}
		c=getch();
		if(c==UP&&now>0){
			gotoXY(31,7+2*now);
			printf(" ");
			now--;
			gotoXY(31,7+2*now);
			printf(">");
		}
		else if(c==DOWN&&now<MAX_SETTINGS){
			gotoXY(31,7+2*now);
			printf(" ");
			now++;
			gotoXY(31,7+2*now);
			printf(">");
		}
		else if(c==LEFT){
			if(now==0){
			    nowlanguage=(nowlanguage-1+NUMOFLANGUAGE)%NUMOFLANGUAGE;
			    gotoXY(34,7+2*now);
			    printf(SETTINGS[language][now][nowlanguage]);
		    }
		    if(now==1){
		    	nowcolor=(nowcolor-1+NUMOFCOLOR)%NUMOFCOLOR;
		    	gotoXY(34,7+2*now);
		    	printf(SETTINGS[language][now][nowcolor]);
			}
		}
		else if(c==RIGHT){
			if(now==0){
			    nowlanguage=(nowlanguage+1+NUMOFLANGUAGE)%NUMOFLANGUAGE;
			    gotoXY(34,7+2*now);
			    printf(SETTINGS[language][now][nowlanguage]);
		    }
		    if(now==1){
		    	nowcolor=(nowcolor+1+NUMOFCOLOR)%NUMOFCOLOR;
		    	gotoXY(34,7+2*now);
		    	printf(SETTINGS[language][now][nowcolor]);
			}
		}
	}
	language=nowlanguage;
	color=nowcolor;
	char cmd[64];
	sprintf(cmd,"color %d7",color);
	system(cmd);
	FILE *fp1=fopen("settings.txt","w");
	fprintf(fp1,"%d %d",language,color);
	fclose(fp1);
}

void readSettings(){
	FILE *fp2=fopen("settings.txt","r");
	if(fp2!=NULL){
		fscanf(fp2,"%d %d",&language,&color);
	}
}